// pages/propertyNews/propertyDetails.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    details: "",
    content: ''
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var _this = this;
    _this.setData({
      id: options.id
    })
    wx.request({
      url: getApp().data.servsers + '/propertyInfo/findById.do',
      method: 'POST',
      data: {
        id: options.id
      },
      header: {
        'content-type': 'application/json' // 默认值
      },
      success(res) {
        let data = res.data;
        if (data.status == 'success') {
          let result = data.data.context;
          const regex = new RegExp('<img', 'gi');
          result = result.replace(regex, `<img style="max-width: 100%;"`);
          _this.setData({
            details: data.data
          })
          _this.setData({
            content: result
          })
        }
      }
    })
  },

})